package com.taptech.doufu.ui.view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.taptech.doufu.R
import com.taptech.doufu.ui.adapter.MarqueeAdapter
import kotlinx.android.synthetic.main.view_marquee.view.*

class MarqueeView(context:Context) :LinearLayout(context){

    constructor(context: Context, attributeSet: AttributeSet) : this(context)
    init {
        initView()
    }

    fun initView() {
        val view = LayoutInflater.from(context).inflate(R.layout.view_marquee,null)
        addView(view)
        val adapter = MarqueeAdapter(context)
        val mutableList = mutableListOf("我的测钉钉搜搜地诶","222222222222222222","999999999999999999999999999","8888888888888888888","我的测钉钉搜搜地诶","222222222222222222","999999999999999999999999999","8888888888888888888","我的测钉钉搜搜地诶","222222222222222222","999999999999999999999999999","8888888888888888888")
        adapter.setData(mutableList)
        mRecyclerView.layoutManager = LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
        mRecyclerView.adapter = adapter
    }

}
